package com.csyaonie.android;

import androidx.appcompat.app.AppCompatActivity;

import android.animation.ObjectAnimator;
import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;

public class AnimateActivity extends AppCompatActivity {

    private TextView a_tv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_animate);
        a_tv=findViewById(R.id.a_tv);

        //a_tv.animate().translationXBy(500).setDuration(2000).start();
        ObjectAnimator objectAnimator=ObjectAnimator.ofFloat(a_tv,"translationY",0,500,200,800,100);
        objectAnimator.setDuration(2000);
        objectAnimator.start();
    }
}